package yws01.Business;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import yws01.DAO.CheweiDAO;
import yws01.Model.Chewei;

import java.util.List;

@Service
public class SaleServiceChewei {
    CheweiDAO cheweiDAO;
    @Autowired
    public void setCheweiDAO(CheweiDAO cheweiDAO) { this.cheweiDAO = cheweiDAO; }
    @Transactional
    public void Cheweiinsrt(Chewei chewei){cheweiDAO.insertChewei(chewei);}
    public void Cheweidelete(Chewei chewei){cheweiDAO.deleteChewei(chewei);}
    public Chewei Cheweiquery(Chewei chewei){System.out.println(cheweiDAO.queryChewei(chewei));return cheweiDAO.queryChewei(chewei);}
    public void Cheweimodify(Chewei chewei){cheweiDAO.modifyChewei(chewei);}
    public List<Chewei> Cheweiall(){return cheweiDAO.queryall();}

}
